Skip to content

M13.7: NFR-16 latency bench + ProxyJump integration harness#14

Merged
UnbreakableMJ merged 2 commits into
mainfrom
feature/m13-7-bench-and-chain-harness
May 4, 2026
Merged

M13.7: NFR-16 latency bench + ProxyJump integration harness#14
UnbreakableMJ merged 2 commits into
mainfrom
feature/m13-7-bench-and-chain-harness

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Summary

Lands the verification surface for the M13 chapter: a russh::server-driven 2-hop integration test (NFR-17) and the loopback NFR-16 bench gate.

Files added

  • tests/test_proxy_jump.rsTestServer russh::server fixture (accepts any auth, transparently relays direct-tcpip channels). Two tests:

    • two_hop_chain_succeeds — bastion + target on loopback, AnvilSession::connect_via_jump_hosts walks the chain.
    • empty_jump_chain_is_rejected — sanity test for the guard.
    • Both #[ignore]-gated behind GITWAY_INTEGRATION_TESTS=1; opt-in via cargo test --test test_proxy_jump -- --ignored.
  • benches/proxy_chain.rs — Criterion harness with the same fixture pattern.

    • proxy_chain/1_hop_direct_cold and proxy_chain/2_hop_via_bastion_cold Criterion benchmarks.
    • enforce_nfr16_ratio runs 16 cold-start measurements outside Criterion and asserts 2-hop median <= 2 * 1-hop median on loopback.
    • Real 50 ms RTT validation is documented as a manual procedure (loopback honestly can't enforce the 1.5 s/hop budget — every hop is sub-millisecond).
    • Bench bodies skip when GITWAY_INTEGRATION_TESTS=1 is unset.
  • tests/ssh_config_matrix/11_jump_chain.yaml — declarative coverage that a ProxyJump chain string survives the resolver as raw text for parse_jump_chain to consume.

  • Cargo.toml — registers the new [[bench]] proxy_chain harness.

Tests

  • 185 lib + 1 matrix + 6 integration + 7 ignored (2 new proxy_jump + 4 from M13.1 stdio + 1 pre-existing RSA SSHSIG); 0 failures.

Test plan

  • CI passes (Linux/macOS/Windows + MSRV 1.88).
  • cargo fmt / cargo clippy --all-targets -- -D warnings clean.
  • cargo test --lib --tests --locked green.
  • Manual: GITWAY_INTEGRATION_TESTS=1 cargo test --test test_proxy_jump -- --ignored passes locally.
  • Manual: GITWAY_INTEGRATION_TESTS=1 cargo bench --bench proxy_chain enforces the NFR-16 ratio without panicking.

Plan: M13.7 of let-us-plan-on-bright-cosmos.md.

🤖 Generated with Claude Code

Lands the verification surface for the M13 chapter:

tests/test_proxy_jump.rs (new):
- TestServer russh::server fixture that accepts any auth + transparently
  relays direct-tcpip channels to the requested host:port.
- spawn_server() helper binds a loopback port and runs the server in
  a tokio::spawn'd task that owns both the server and the listener.
- two_hop_chain_succeeds: spawns bastion + target, points
  AnvilSession::connect_via_jump_hosts at the chain, asserts success
  (NFR-17 host-key verification path runs at every hop).
- empty_jump_chain_is_rejected: sanity test for the empty-list guard.
- Both tests #[ignore]-gated behind GITWAY_INTEGRATION_TESTS=1 so CI
  doesn't spin up russh::server instances on every run; opt-in via
  `GITWAY_INTEGRATION_TESTS=1 cargo test --test test_proxy_jump
  -- --ignored`.

benches/proxy_chain.rs (new):
- BenchServer mirrors TestServer for use inside the Criterion harness.
- Two Criterion benchmarks: proxy_chain/1_hop_direct_cold and
  proxy_chain/2_hop_via_bastion_cold.
- enforce_nfr16_ratio runs 16 cold-start measurements outside
  Criterion and asserts 2-hop median <= 2 * 1-hop median on
  loopback. NFR-16's 1.5-s/hop budget on a 50-ms RTT link is honest
  only on a real network; the loopback gate enforces the relative
  shape, with real-RTT validation documented as a manual procedure
  in the M13 plan.
- Bench bodies skip when GITWAY_INTEGRATION_TESTS=1 is unset so cargo
  bench doesn't accidentally depend on a running russh::server in CI.

tests/ssh_config_matrix/11_jump_chain.yaml (new):
- Declarative coverage of ProxyJump capture: a chain string survives
  the resolver as raw text for M13.3's parse_jump_chain to consume.

Cargo.toml: registers the new [[bench]] proxy_chain harness.

Tests: 185 lib + 1 matrix + 6 integration + 2 ignored proxy_jump
+ 5 ignored (existing); 0 failures.

Plan: M13.7 of let-us-plan-on-bright-cosmos.md.
Linux fmt prefers the single-line form for the shorter expect message;
my local Windows fmt had auto-wrapped to two lines (same issue we hit
in M12.4). Squashes the lint-job failure on Anvil PR #14.
@UnbreakableMJ
UnbreakableMJ merged commit e476519 into main May 4, 2026
5 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the feature/m13-7-bench-and-chain-harness branch May 4, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant